package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbProjectExperience;
import rpd.model.TbProjectExperienceExample;
import rpd.model.TbProjectExperienceKey;
import rpd.model.TbProjectExperienceWithBLOBs;

public interface TbProjectExperienceMapper {
    long countByExample(TbProjectExperienceExample example);

    int deleteByExample(TbProjectExperienceExample example);

    @Delete({
        "delete from tb_project_experience",
        "where id = #{id,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbProjectExperienceKey key);

    @Insert({
        "insert into tb_project_experience (id, name, start_time, ",
        "end_time, duty, resume_id, ",
        "describe, technology)",
        "values (#{id,jdbcType=CHAR}, #{name,jdbcType=CHAR}, #{startTime,jdbcType=DATE}, ",
        "#{endTime,jdbcType=DATE}, #{duty,jdbcType=CHAR}, #{resumeId,jdbcType=CHAR}, ",
        "#{describe,jdbcType=LONGVARCHAR}, #{technology,jdbcType=LONGVARCHAR})"
    })
    int insert(TbProjectExperienceWithBLOBs record);

    int insertSelective(TbProjectExperienceWithBLOBs record);

    List<TbProjectExperienceWithBLOBs> selectByExampleWithBLOBs(TbProjectExperienceExample example);

    List<TbProjectExperience> selectByExample(TbProjectExperienceExample example);

    @Select({
        "select",
        "id, name, start_time, end_time, duty, resume_id, describe, technology",
        "from tb_project_experience",
        "where id = #{id,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbProjectExperienceMapper.ResultMapWithBLOBs")
    TbProjectExperienceWithBLOBs selectByPrimaryKey(TbProjectExperienceKey key);

    int updateByExampleSelective(@Param("record") TbProjectExperienceWithBLOBs record, @Param("example") TbProjectExperienceExample example);

    int updateByExampleWithBLOBs(@Param("record") TbProjectExperienceWithBLOBs record, @Param("example") TbProjectExperienceExample example);

    int updateByExample(@Param("record") TbProjectExperience record, @Param("example") TbProjectExperienceExample example);

    int updateByPrimaryKeySelective(TbProjectExperienceWithBLOBs record);

    @Update({
        "update tb_project_experience",
        "set name = #{name,jdbcType=CHAR},",
          "start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "duty = #{duty,jdbcType=CHAR},",
          "resume_id = #{resumeId,jdbcType=CHAR},",
          "describe = #{describe,jdbcType=LONGVARCHAR},",
          "technology = #{technology,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(TbProjectExperienceWithBLOBs record);

    @Update({
        "update tb_project_experience",
        "set name = #{name,jdbcType=CHAR},",
          "start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "duty = #{duty,jdbcType=CHAR},",
          "resume_id = #{resumeId,jdbcType=CHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbProjectExperience record);
}